import { IsArray, IsEnum, IsOptional, IsString, Length } from 'class-validator';
import { PagingDto } from 'src/common/dto/index';
import { ProjectStatusEnum } from './create-project.dto';
import { Transform, Type } from 'class-transformer';
export class ListProjectDto extends PagingDto {
    @IsOptional()
    @IsString()
    @Length(0, 30)
    projectName?: string;

    @IsOptional()
    @IsString()
    @IsEnum(ProjectStatusEnum)
    status?: string;

    @Transform(({ value }) => {
        if (typeof value === 'string') {
            return value.split(',').map(Number);
        }
        return value;
    })
    @IsOptional()
    @IsArray()
    leader?: number[];

    @Transform(({ value }) => {
        if (typeof value === 'string') {
            return value.split(',').map(Number);
        }
        return value;
    })
    @IsArray()
    @IsOptional()
    member?: number[];
}
